//
//  MenuCollectionViewCell.m
//  pritice
//
//  Created by ChuXiang on 16/1/12.
//  Copyright © 2016年 ChuXiang. All rights reserved.
//

#import "MenuCollectionViewCell.h"
@interface MenuCollectionViewCell ()
@end


@implementation MenuCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel = [UILabel new];
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        [self.titleLabel setFont:[UIFont fontWithName:@"FZLanTingHei-EL-GBK" size:13]];
        self.titleLabel.layer.borderWidth = 0.5;
        self.titleLabel.layer.borderColor = [UIColor grayColor].CGColor;
        self.titleLabel.layer.cornerRadius = 3;
        self.titleLabel.layer.masksToBounds = YES;
        [self addSubview:self.titleLabel];
        

    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    [super applyLayoutAttributes:layoutAttributes];
    self.titleLabel.frame = CGRectMake(8, 10, self.frame.size.width - 14, self.frame.size.height - 10);
}

- (void)setTitle:(NSString *)name withButtonHaveEdit:(BOOL)haveEdit {


    if (name) {
        self.titleLabel.text = name;
//        if (!haveEdit) {
//            
//            self.deleteButton.alpha = 1;
//        }else {
//            self.deleteButton.alpha = 0;
//        }
    }
}
@end
